package com.leonzhangxf.springdatastudy.repo;

import com.leonzhangxf.springdatastudy.repo.entity.User;
import org.springframework.data.domain.AuditorAware;
import org.springframework.lang.NonNull;

import java.util.Optional;

/**
 * @author leonzhangxf
 */
public class UserAuditorAwareImpl implements AuditorAware<User> {

    @Override
    @NonNull
    public Optional<User> getCurrentAuditor() {
        return Optional.of(new User("leonzhangxf@gmail.com"));
    }
}
